package flca.voicenav.model;

import com.google.android.maps.GeoPoint;


public class TrkPt
{
	private double lat = 0.0;
	private double lng = 0.0;
	private double elevation = 0.0;
	private String comment;
	private int distance = 0; //distance in meters to next segment
	private double angle = 0; //angle between this and next segment
	private String sayAngle; // this is what the user will hear, if this is a corner
	private int index; //in the arraylist
	private boolean isCorner = true; //asume
	
	// used by xml pull parser!
	private boolean latSet = false;
	private boolean lngSet = false;
	
	public TrkPt() {
		super();
	}

	//used by the xml pull parser
	public boolean isValid() {
		return latSet && lngSet;
	}
	
	public double getLat()
	{
		return lat;
	}
	public void setLat(double lat)
	{
		this.lat = lat;
		this.latSet = true;
	}
	public double getLng()
	{
		return lng;
	}
	public void setLng(double lng)
	{
		this.lng = lng;
		this.lngSet = true;
	}
	public double getElevation()
	{
		return elevation;
	}
	public void setElevation(double elevation)
	{
		this.elevation = elevation;
	}
	public String getComment()
	{
		return comment;
	}
	public void setComment(String comment)
	{
		this.comment = comment;
	}
	
	public int getDistance() {
		return distance;
	}

	public void setDistance(int distance) {
		this.distance = distance;
	}

	public double getAngle()
	{
		return angle;
	}

	public void setAngle(double angle)
	{
		this.angle = angle;
	}

	
	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public boolean isCorner() {
		return isCorner;
	}

	public void setCorner(boolean isCorner) {
		this.isCorner = isCorner;
	}

	
	public String getSayAngle()
	{
		return sayAngle;
	}

	public void setSayAngle(String sayAngle)
	{
		this.sayAngle = sayAngle;
	}

	@Override
	public String toString()
	{
		return "TrkPt [lat=" + lat + ", lng=" + lng + ", dist=" + distance + ", say" + sayAngle + "]";
	}

	public GeoPoint toGeoPoint() 
	{
		return new GeoPoint((int) (this.getLat() * 1E6), (int) (this.getLng() * 1E6)); 
	}
}
